package com.example.sid.ui.fragments

import android.widget.Button
import androidx.fragment.app.Fragment
import com.example.sid.R
import com.example.sid.ui.fragments.utils.navigateTo

/**
 * Проходной фрагмент разделяющий фичи.
 */
class RootFragment : Fragment(R.layout.fragment_root) {

	private val initializeWay: Button get() = requireView().findViewById(R.id.initialize_way)
	private val loginWay: Button get() = requireView().findViewById(R.id.login_way)
	private val appTokenWay: Button get() = requireView().findViewById(R.id.app_token_way)
	private val elkWay: Button get() = requireView().findViewById(R.id.elk_way)

	override fun onStart() {
		super.onStart()

		initializeWay.setOnClickListener {
			navigateTo(RootFragmentDirections.actionRootFragmentToInitializerGraph())
		}
		loginWay.setOnClickListener {
			navigateTo(RootFragmentDirections.actionRootFragmentToLoginGraph())
		}
		appTokenWay.setOnClickListener {
			navigateTo(RootFragmentDirections.actionRootFragmentToAppTokenGraph())
		}
		elkWay.setOnClickListener {
			navigateTo(RootFragmentDirections.actionRootFragmentToElkGraph())
		}

	}
}